$(function () {
    $("#systemLog_datagrid").datagrid({
        title:"日志管理",
        fit:true,
        fitColumns:true,
        url:"/systemLog/listAll.do",
        singleSelect:true,
        striped:true,
        pagination:true,
        toolbar:'#log_btn',
        rownumbers:true,
        columns:[[
            {field:'id',checkbox:true},
            {field:'opUser_id',title:'数量',width:80},
            {field:'opTime',title:'操作时间',width:80},
            {field:'opIp',title:'操作Ip',width:80},
            {field:'function',title:'操作方法',width:80},
            {field:'params',title:'操作人',width:80}
        ]]

    });
    $("#delete_dialog").dialog({
        width:350,
        height:200,
        closed:true,
        buttons:'#form_btns',
    })
});
function cancel() {
    $("#delete_dialog").dialog('close')
}
function save() {
    /*var row = $("#systemLog_datagrid").datagrid('getSelected');
    $("#delete_form").form('load',row);//回显上面选中的数据,回显隐藏id的大招*/
    var row = $("#systemLog_datagrid").datagrid('getSelected');
    if(!row){
       /* $.messager.alert('温馨提示','请选择一条数据','warning');*/
    $("#delete_form").form('submit',{
        url:'/systemLog/deleteAll.do',
        success:function (data) {
            data = eval('(' + data + ')');
            if(data.success){
                $.messager.alert('温馨提示','确认删除','info',function () {
                    cancel();
                    $("#systemLog_datagrid").datagrid('reload')
                })
            }else{
                $.messager.alert('温馨提示','保存失败','error')
            }
        }
    })
        return;
    }
}
function del() {
    $("#delete_dialog").dialog('open');
    $("#delete_dialog").dialog('setTitle','删除员工')
}